<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
  html,
  body{
     height: 100%;
     /* display: flex;
     justify-content: center;
     align-items: center; */
     position: relative;
   }
   .box{
    width: 200px;
    height: 200px;
    background-color: skyblue;
    position: absolute;
    top: 50%;
    left: 50%;
    /* margin-top: -100px;
    margin-left: -100px; */
    /*translate 第一个参数 就是 x 第二个参数 y轴  */
    transform: translate(-50%,-50%);
   }
   .content{
     list-style: none;
     display: flex;
   }
   li{
    flex: 1;
    background-color: slateblue;
    margin-right: 10px;
    text-align: center;
   }
</style>
<body>
    <!-- 上下左右都居中 -->
    <!-- 可以利用 弹性盒子，让其上下左右都居中 -->
    <!-- <div class="box"></div> -->

    <ul class="content">
        <li>1</li>
        <li>2</li>
        <li>3</li>
    </ul>
</body>
</html>